package main;

import model.Movie;
import model.VideoTheek;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import dao.MovieDao;
import dao.VideoTheekDaoImpl;


public class App{
	
	public static void main( String[] args ) {
		ApplicationContext appContext = new ClassPathXmlApplicationContext( "config/spring-configuration.xml" );
		
		Movie lifeOfPi = new Movie();
		lifeOfPi.setReleaseYear( 2012 );
		lifeOfPi.setDirector( "Ang Lee" );
		lifeOfPi.setTitle( "Life of Pi" );
		
		Movie dabangg2 = new Movie();
		dabangg2.setReleaseYear( 2012 );
		dabangg2.setDirector( "Arbaaz Khan" );
		dabangg2.setTitle( "Dabangg 2" );
		
		VideoTheek vTheek = new VideoTheek();
		vTheek.setName( "VideoTheek Enschede" );
		vTheek.addMovie( lifeOfPi );
		vTheek.addMovie( dabangg2 );
		
		
		VideoTheekDaoImpl vTheekDaoImpl = (VideoTheekDaoImpl) appContext.getBean( "videoTheekDao" );
		vTheekDaoImpl.createVideoTheek( vTheek );
	}
}